//
//  marco.h
//  MagicWord
//
//  Created by Chen Qi on 2/9/14.
//  Copyright (c) 2014 Apportable. All rights reserved.
//

// This file is used to define macros for now.
// TODO: split macros into different header files and use this one as an umbrella file

#ifndef MagicWord_macro_h
#define MagicWord_macro_h

// Disable assert for product release
#ifdef PRODUCT_RELEASE
#undef assert
#define assert(expr) do {} while(false);
#endif

// Macros for logging with levels
#define LOG_EMERG   0  /* system is unusable */
#define LOG_ALERT   1  /* action must be taken immediately */
#define LOG_CRIT    2  /* critical conditions */
#define LOG_ERR     3  /* error conditions */
#define LOG_WARNING 4  /* warning conditions */
#define LOG_NOTICE  5  /* normal but significant condition */
#define LOG_INFO    6  /* informational */
#define LOG_DEBUG   7  /* debug-level messages */

//////////////////////////////////////
#define DEFAULT_LOGGING_LEVEL LOG_INFO
//////////////////////////////////////

#define NSLogEMERG(frmt, ...) do { if(DEFAULT_LOGGING_LEVEL >= LOG_EMERG) NSLog((frmt), ##__VA_ARGS__);} while (0)
#define NSLogALERT(frmt, ...) do { if(DEFAULT_LOGGING_LEVEL >= LOG_ALERT) NSLog((frmt), ##__VA_ARGS__);} while (0)
#define NSLogCRIT(frmt, ...) do { if(DEFAULT_LOGGING_LEVEL >= LOG_CRIT) NSLog((frmt), ##__VA_ARGS__);} while (0)
#define NSLogERR(frmt, ...) do { if(DEFAULT_LOGGING_LEVEL >= LOG_ERR) NSLog((frmt), ##__VA_ARGS__);} while (0)
#define NSLogWARNING(frmt, ...) do { if(DEFAULT_LOGGING_LEVEL >= LOG_WARNING) NSLog((frmt), ##__VA_ARGS__);} while (0)
#define NSLogNOTICE(frmt, ...) do { if(DEFAULT_LOGGING_LEVEL >= LOG_NOTICE) NSLog((frmt), ##__VA_ARGS__);} while (0)
#define NSLogINFO(frmt, ...) do { if(DEFAULT_LOGGING_LEVEL >= LOG_INFO) NSLog((frmt), ##__VA_ARGS__);} while (0)
#define NSLogDEBUG(frmt, ...) do { if(DEFAULT_LOGGING_LEVEL >= LOG_DEBUG) NSLog((frmt), ##__VA_ARGS__);} while (0)

// Macros for graphical elements
//////////////////////////////////
///// Cards Defination
#define TOTAL_SOURCE_CRADS 12
#define TOTAL_DEST_CARDS 9
//////////////////
#endif
